package z_exam; /**
 * @Author: 海琳琦
 * @Date: 2022/3/21 20:25
 */
import java.util.*;

public class Solution1 {
    public static List<List<String>> listList = new ArrayList<>();

    public static List<List<String>> partition(String s) {
        nextWords(s, 0, new ArrayList<>());
        return listList;
    }

    public static void nextWords(String s, int index, List<String> list){
        if(index == s.length()){
            listList.add(new ArrayList<>(list));
            return;
        }
        for(int i = index; i < s.length(); i++){
            String subStr = s.substring(index, i + 1);
            list.add(subStr);
            nextWords(s, i + 1, list);
            list.remove(list.size() - 1);
        }
    }

    public static int getsocre(String s){
        Map<Character, Integer> map = new HashMap<>();
        for(int i = 0; i < s.length(); i++){
            map.put(s.charAt(i), 0);
        }
        for(int i = 0; i < s.length(); i++){
            map.put(s.charAt(i), map.get(s.charAt(i)) + 1);
        }
        int socre = 0 ;
        for(Map.Entry<Character, Integer> entry : map.entrySet()){
            if(entry.getValue() % 2 == 0){
                socre += 1;
            }else{
                socre -= 1;
            }
        }
        return socre;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String s = sc.next();
        int max = Integer.MIN_VALUE;
        List<List<String>> partition = partition(s);
        for(int i = 0; i < partition.size(); i++){
            List<String> list = partition.get(i);
            int temp = 0;
            for(int j = 0; j < list.size(); j++){
                temp += getsocre(list.get(j));
            }
            max = Math.max(max, temp);
        }
        System.out.println(max);
    }
}